<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>一朵 - 首页</title>
<link rel="stylesheet" href="__STATIC__/index/js/swiper/idangerous.swiper.css">
<!-- swiper-2.7js -->
<script src="__STATIC__/index/js/swiper/idangerous.swiper.min.js"></script>
<!-- jquery-3.2.1引用 -->
<script src="__STATIC__/index/js/global/jquery-3.2.1.min.js"></script>
<!-- 阿里巴巴矢量图库 -->
<link rel="stylesheet" href="http://at.alicdn.com/t/font_561814_q1vg409ad6coko6r.css">
<!-- 公共头部 脚部 -->
<link rel="stylesheet" href="__STATIC__/index/css/global/global.css">
<!-- 超过1200屏幕 -->
<link rel="stylesheet" media="screen and (min-width: 1200px)" href="__STATIC__/index/css/index/index1200.css" />
<!-- 1080-1200 -->
<link rel="stylesheet" media="screen  and (min-width: 1080px) and (max-width: 1199px) " href="__STATIC__/index/css/index/index1080.css"
/>
<!-- 960-1080 -->
<link rel="stylesheet" media="screen  and (min-width: 960px) and (max-width: 1079px) " href="__STATIC__/index/css/index/index960.css"
/>
<!-- 768-959 -->
<link rel="stylesheet" media="screen  and (min-width: 768px) and (max-width: 959px) " href="__STATIC__/index/css/index/index768.css"
/>
<!-- 568-767 -->
<link rel="stylesheet" media="screen  and (min-width: 568px) and (max-width: 767px) " href="__STATIC__/index/css/index/index568.css"
/>
<!-- 375-567 -->
<link rel="stylesheet" media="screen  and (min-width: 375px) and (max-width: 567px) " href="__STATIC__/index/css/index/index375.css"
/>
<!-- 小于375-->
<link rel="stylesheet" media="screen  and (max-width: 374px) " href="__STATIC__/index/css/index/index320.css" />
<!--引入layer-->
<script src="__STATIC__/layer/layer.js"></script>
</head>

<body>
    <div class="M">
        <!-- M头部组件 -->
        {include file="public/m_header" /}
        <!-- M导航条轮播 -->
        <div class="swiper-container1 M-index-swiper">
            <div class="swiper-wrapper">
                {volist name="category" id="v"}
                <div class="swiper-slide">
                    <a href="{:url('GoodsList/goods_list')}?cate_id={$v.id}" class="swiper-a">
                        {$v.title}
                    </a>
                </div>
                {/volist}
            </div>
        </div>
        <!-- Mbanner轮播 -->
        <div class="M-carousel">
            <div class="swiper-container2">
                <div class="swiper-wrapper">
                    {volist name="banner" id="v"}
                    <div class="swiper-slide ">
                        <a href="{:url('GoodsList/goods_detail')}?id={$v.goods_id}">
                            <img src="{$v.mo_banner}" alt="">
                        </a>
                    </div>
                    {/volist}
                </div>
            </div>
        </div>
        <!-- M版热点 -->
        <a href="{:url('GoodsList/goods_detail')}?id={$advert_1.goods_id}" class="M-hot">
            <div>
                <img src="{$advert_1.hot_mo_banner}" alt="">
            </div>
            <div>
                <div>
                    <!--<div>-->
                        <!--<img src="__STATIC__/index/img/index/m_sole.png" alt="">-->
                    <!--</div>-->
                    <!--<div>-->
                        <!--<p>{$advert_1.title}</p>-->
                        <!--<p>{$advert_1.subtitle}</p>-->
                    <!--</div>-->
                </div>
                <!--<p>/{$advert_1.description}/</p>-->
            </div>
        </a>
        <div class="M-discounts">
            <p>领取店铺优惠</p>
            {if condition="$count_coupon eq 2"}
            <div class="M-discounts-three">
                {foreach name="coupon" item="v"}
                <div>
                    <a href="javascript:;" onclick="receive_coupon({$v.id})">
                        <span>￥{$v.reduce}</span>&nbsp;&nbsp;优惠券
                    </a>
                </div>
                {/foreach}
                <div>
                    <a href="{:url('User/my_coupon')}">
                        <span>更多优惠</span>
                    </a>
                </div>
            </div>
            {/if} {if condition="$count_coupon eq 1"}
            <div class="M-discounts-two">
                {foreach name="coupon" item="v"} {if condition="$v.is_receive eq 0"}
                <div>
                    <a href="javascript:;" onclick="receive_coupon({$v.id})">
                        <span>￥{$v.reduce}</span>&nbsp;&nbsp;优惠券
                    </a>
                </div>
                {/if} {/foreach}
                <div>
                    <a href="{:url('User/my_coupon')}">
                        <span>更多优惠</span>
                    </a>
                </div>
            </div>
            {/if} {if condition="$count_coupon eq 0"}
            <div class="M-discounts-one">
                <div>
                    <a href="javascript:;">暂无优惠券</a>
                </div>
            </div>
            {/if}
        </div>
        <!-- M优惠券 -->
        <!--  -->
        <!-- M三个蛋糕 -->
        {volist name="recommend_goods_1" id="v"}
        <a href="{:url('GoodsList/goods_detail')}?id={$v.goods_id}" class="M-hot-bread">
            <div>
                <img src="{$v.logo}" alt="">
            </div>
            <div>
                <div>{$v.name}</div>
                <div>{$v.subtitle}</div>
                <div>
                    ￥{$v.price}
                </div>
            </div>
        </a>
        {/volist}
        <!-- M更多  标题 -->
        <a href="{:url('GoodsList/goods_list')}?cate_id={$recommend_category_1.id}" class="gengduo M">
            <div>
                <p>
                    <span>更多{$recommend_category_1.title}</span>
                    <span>{$recommend_category_1.description}</span>
                    <span>{$recommend_category_1.description}</span>
                </p>
            </div>
            <div>
                <span class="iconfont icon-msnui-menu-right"></span>
            </div>
        </a>
        <!-- M广告图片 -->
        <a href="{:url('GoodsList/goods_detail')}?id={$advert_2.goods_id}" class="M-banner">
            <img src="{$advert_2.m_logo}" alt="">
            <!--<div>-->
                <!--<p>{$advert_2.title}</p>-->
                <!--<p>{$advert_2.subtitle}</p>-->
                <!--<p>￥-->
                    <!--<span>{$advert_2.price}</span>-->
                <!--</p>-->
            <!--</div>-->
        </a>
        <!-- 四个饮品 -->
        <div class="M-drink">
            {volist name="recommend_goods_2" id="v"}
            <a href="{:url('GoodsList/goods_detail')}?id={$v.goods_id}">
                <div>
                    <div>
                        <p>{$v.name}</p>
                        <p>{$v.subtitle}</p>
                        <div>￥{$v.price}</div>
                    </div>
                    <img src="{$v.logo}" alt="">
                </div>
            </a>
            {/volist}
        </div>
        <!-- M更多  标题 -->
        <a href="{:url('GoodsList/goods_list')}?cate_id={$recommend_category_2.id}" class="gengduo M">
            <div>
                <p>
                    <span>{$recommend_category_2.title}</span>
                    <span>{$recommend_category_2.description}</span>
                    <span>{$recommend_category_2.description}</span>
                </p>
            </div>
            <div>
                <span class="iconfont icon-msnui-menu-right"></span>
            </div>
        </a>
        <!-- M联系方式 -->
        <div class="M-number">
            <p>/传递爱与感动的温柔美食/</p>
            <p>A GENTLE DELICACY THAT CONVEYS LOVE AND AFFECTION</p>
            <div>
                <span class="iconfont icon-msnui-telephone"></span>
                <span>{:sysconf('site_phone')}</span>
                <span>(服务时间 08:00-22:00)</span>
            </div>
        </div>

        {include file="public/m_footer" /}
        <div class="M-youhui" {if condition="$has_qy_coupon eq 0" } style="display:none;" {/if}>
            <div class="M-youhui-content">
                <div>
                    <p>恭喜您获得会员优惠券</p>
                    <img src="{$qy_coupon.m_beijing}" alt="">
                    <a href="javascript:;" onclick="get_qy_coupon()">
                        一键领取
                    </a>
                </div>
                <div>
                    <span class="iconfont icon-cuowutishi" id="M-youhui-esc" onclick="close_coupon();"></span>
                </div>

            </div>
        </div>
    </div>
    <!-- 优惠卷领取 -->


    <!-- PC端整体 -->
    <div class="PC">
        <!-- PC头部模块 -->
        {include file="public/p_header" /}
        <!-- pc轮播 -->
        <div class="PC-carousel">
            <div class="arrow-left">
                <img src="__STATIC__/index/img/swiper/list.png" alt="">
            </div>
            <div class="arrow-right">
                <img src="__STATIC__/index/img/swiper/right.png" alt="">
            </div>
            <div class="swiper-container">
                <div class="swiper-wrapper">
                    {volist name="banner" id="v"}
                    <div class="swiper-slide">
                        <a href="{:url('GoodsList/goods_detail')}?id={$v.goods_id}" style="background-image: url('{$v.pc_banner}')">
                        </a>
                    </div>
                    {/volist}
                </div>
            </div>
        </div>
        <!-- 首页内容 -->
        <div class="PC-content">
            <!-- 搜索框 -->
            <div class="PC-seek">
                <div>
                    <input type="text" name="key" id="key" placeholder="点击搜索艺术美食 ">
                    <span class="iconfont icon-sousuo" onclick="search();"></span>
                </div>
            </div>
            <!-- PC热点 -->
            <div class="PC-hot">
                <div>
                    <img src="{$advert_1.hot_pc_banner}" alt="">
                </div>
                <div>
                    <div>
                        <p>/ {$advert_1.description} /</p>
                    </div>
                    <div>
                        <p>{$advert_1.name}</p>
                        <p>{$advert_1.subtitle}</p>
                        <p>{$advert_1.base_spec}</p>
                        <a href="{:url('GoodsList/goods_detail')}?id={$advert_1.goods_id}">点 击 购 买</a>
                    </div>
                </div>
            </div>
            <!-- 优惠券 -->

            <div class="PC-discounts">
                <p>领取店铺优惠</p>
                {if condition="$count_coupon eq 2"}
                <div class="pc-discounts-three">
                    {foreach name="coupon" item="v"}
                    <div>
                        <a href="javascript:;" onclick="receive_coupon({$v.id})">
                            <span>￥{$v.reduce}</span>&nbsp;&nbsp;优惠券
                        </a>
                    </div>
                    {/foreach}
                    <div>
                        <a href="{:url('User/my_coupon')}">
                            <span>更多优惠</span>
                        </a>
                    </div>
                </div>
                {/if} {if condition="$count_coupon eq 1"}
                <div class="pc-discounts-two">
                    {foreach name="coupon" item="v"} {if condition="$v.is_receive eq 0"}
                    <div>
                        <a href="javascript:;" onclick="receive_coupon({$v.id})">
                            <span>￥{$v.reduce}</span>&nbsp;&nbsp;优惠券
                        </a>
                    </div>
                    {/if} {/foreach}
                    <div>
                        <a href="{:url('User/my_coupon')}">
                            <span>更多优惠</span>
                        </a>
                    </div>
                </div>
                {/if} {if condition="$count_coupon eq 0"}
                <div class="pc-discounts-one">
                    <div>
                        <a href="javascript:;">暂无优惠券</a>
                    </div>
                </div>
                {/if}
            </div>


            <!-- 品牌 pc-->
            <div class="PC-brand">
                <div class="PC-brand-headline">
                    <div>
                        <div>
                            <div>
                                品牌{$recommend_category_1.title}
                            </div>
                            <div>
                                <span>{$recommend_category_1.description}</span>&nbsp;&nbsp;
                                <span>{$recommend_category_1.description}</span>
                            </div>
                        </div>
                        <div>
                            <a href="{:url('GoodsList/goods_list')}?cate_id={$recommend_category_1.id}">
                                M O R E
                            </a>
                        </div>
                    </div>
                </div>
                <div>
                    {volist name="recommend_goods_1" id="v"}
                    <div>
                        <div>
                            <a href="{:url('GoodsList/goods_detail')}?id={$v.goods_id}">
                                <img src="{$v.logo}" alt="">
                            </a>
                        </div>
                        <div>
                            <a href="{:url('GoodsList/goods_detail')}?id={$v.goods_id}">
                                <p>{$v.name}</p>
                            </a>
                            <a href="{:url('GoodsList/goods_detail')}?id={$v.goods_id}">
                                <p>{$v.subtitle}</p>
                            </a>
                            <a href="{:url('GoodsList/goods_detail')}?id={$v.goods_id}">
                                <p>￥
                                    <span>{$v.price}</span>
                                </p>
                            </a>
                            <a href="{:url('GoodsList/goods_detail')}?id={$v.goods_id}">购 买</a>
                        </div>
                    </div>
                    {/volist}
                </div>
            </div>
            <div class="PC-banner">
                <a href="{:url('GoodsList/goods_detail')}?id={$advert_2.goods_id}">
                    <img src="{$advert_2.pc_logo}" alt="">
                    <!--<div>-->
                        <!--<p>{$advert_2.name}</p>-->
                        <!--<p>{$advert_2.description}</p>-->
                        <!--<p>￥-->
                            <!--<span>{$advert_2.price}</span>-->
                        <!--</p>-->
                    <!--</div>-->
                </a>
            </div>
            <!-- 饮品 pc-->
            <div class="PC-beverage">
                <div class="PC-beverage-headline">
                    <div>
                        <div>
                            <div>
                                品牌{$recommend_category_2.title}
                            </div>
                            <div>
                                <span>{$recommend_category_2.description}</span>&nbsp;&nbsp;
                                <span>{$recommend_category_2.description}</span>
                            </div>
                        </div>
                        <div>
                            <a href="{:url('GoodsList/goods_list')}?cate_id={$recommend_category_2.id}">
                                M O R E
                            </a>
                        </div>
                    </div>
                </div>
                <div>
                    {volist name="recommend_goods_2" id="v"}
                    <div>
                        <div>
                            <a href="{:url('GoodsList/goods_detail')}?id={$v.goods_id}">
                                <img src="{$v.logo}" alt="">
                            </a>
                        </div>
                        <div>
                            <a href="{:url('GoodsList/goods_detail')}?id={$v.goods_id}">
                                <p>{$v.name}</p>
                            </a>
                            <a href="{:url('GoodsList/goods_detail')}?id={$v.goods_id}">
                                <p>{$v.subtitle}</p>
                            </a>
                            <a href="{:url('GoodsList/goods_detail')}?id={$v.goods_id}">
                                <p>￥
                                    <span>{$v.price}</span>
                                </p>
                            </a>
                            <a href="{:url('GoodsList/goods_detail')}?id={$v.goods_id}">购 买</a>
                        </div>
                    </div>
                    {/volist}
                </div>
            </div>
        </div>

        <!-- PC端公共脚部 -->
        {include file="public/p_footer" /}
        <div class="PC-roll" {if condition="$has_qy_coupon eq 0" } style="display:none;" {/if}>
            <div class="PC-roll-content">
                <p>恭喜您获得</p>
                <p>
                    {$member.title}会员权益优惠券</p>
                <!--<img src="__STATIC__/index/img/index/pc_roll.png" alt="">-->
                <img src="{$qy_coupon.pc_beijing}" alt="">
                <div>
                    <a href="{:url('User/my_coupon')}">查看优惠券</a>
                    <div onclick="get_qy_coupon()">一键领取</div>
                </div>
            </div>
        </div>
    </div>
    <!-- <script src="__STATIC__/index/js/global/pc_select.js"></script> -->
    <!--<script src="__STATIC__/index/js/global/global.js"></script>-->
    <script type="text/javascript">
        // 移动端导航条
        var mySwiper = new Swiper('.swiper-container1', {
            slidesPerView: 5,
            freeMode: false,
        });
        // // 移动端轮播图
        var mySwiper = new Swiper('.swiper-container2', {
            loop: true,
            autoplay: 3000,
        });
        $(function () {
            if (!placeholderSupport()) { // 判断浏览器是否支持 placeholder
                $('[placeholder]').focus(function () {
                    var input = $(this);
                    if (input.val() == input.attr('placeholder')) {
                        input.val('');
                        input.removeClass('placeholder');
                    }
                }).blur(function () {
                    var input = $(this);
                    if (input.val() == '' || input.val() == input.attr('placeholder')) {
                        input.addClass('placeholder');
                        input.val(input.attr('placeholder'));
                    }
                }).blur();
            };
        })

        function placeholderSupport() {
            return 'placeholder' in document.createElement('input');
        }
    </script>
    <script>
        // PC端轮播图
        var mySwiper = new Swiper('.swiper-container', {
            loop: true,
            autoplay: 3000,
            speed: 1000,
        });
        $('.arrow-left').on('click', function (e) {
            console.log(1);
            e.preventDefault()
            mySwiper.swipePrev()
        });
        $('.arrow-right').on('click', function (e) {
            e.preventDefault()
            mySwiper.swipeNext()
        });
        /**
         * 搜索艺术美食
         */
        function search() {
            var key = $('input[name=key]').val();
            window.location.href = "{:url('Index/search')}?key=" + key;
        }
        /**
         * 意见领取权益优惠券
         */
        function get_qy_coupon() {
            $.post("{:url('Index/get_qy_coupon')}", {
                    id: 1
                },
                function (data) {
                    if (data.code == 1) {
                        layer.msg('领取成功', {
                            icon: 1,
                            time: 1500,
                            shade: 0.1
                        }, function (index) {
                            layer.close(index);
                            location.reload();
                        });
                    } else {
                        layer.msg(data.msg, {
                            icon: 2,
                            time: 1500,
                            shade: 0.1
                        }, function (index) {
                            layer.close(index);
                        });
                    }
                }
            );
        }

        /**
         * 领取优惠券
         * @param id
         */
        function receive_coupon(id) {
            $.post("{:url('Index/receive_coupon')}", {
                    id: id
                },
                function (data) {
                    if (data.code == 1) {
                        layer.msg('领取成功', {
                            icon: 1,
                            time: 1500,
                            shade: 0.1
                        }, function (index) {
                            layer.close(index);
                            location.reload();
                        });
                        return false;
                    } else {
                        layer.msg(data.msg, {
                            icon: 1,
                            time: 1500,
                            shade: 0.1
                        }, function (index) {
                            layer.close(index);
                        });
                        return false;
                        //                            if(data.data == 7){     //去登陆
                        //                                window.location.href = "{:url('Login/loginin')}";
                        //                            }
                    }
                }
            );
        }
        /**
         * 关闭优惠券
         */
        function close_coupon() {
            $('.M-youhui').css('display', 'none');
        }
    </script>
</body>

</html>